@extends('admin::layouts.master')
@section('title')
    收益明细
@endsection
@section('tab')
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <form class="layui-form layui-col-space5">
                            <div class="layui-input-inline">
                                <input type="text" name="date_range" value="{{$arr_search['date_range']}}" class="layui-input" id="test6" placeholder=" - ">
                            </div>
                            <div class="layui-inline layui-show-xs-block">
                                <button class="layui-btn layui-btn-normal"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                                <a class="layui-btn" onclick="location.reload()">
                                    <i class="layui-icon layui-icon-refresh"></i>
                                </a>
                            </div>
                        </form>
                    </div>
                    <div class="layui-card-body layui_overflow_y">

                        <table class="layui-table layui-form">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>日期</th>
                                <th>收益</th>
                                <th>接单数</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($data as $key=>$value)
                                <tr>
                                    <td>{{$key+1}}</td>
                                    <td>{{$value["date"]}}</td>
                                    <td>{{$value["profit"]}}</td>
                                    <td>{{$value["num"]}}</td>
                                </tr>

                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('tab_js')
    <script>
        layui.use(['form','laydate'], function () {
            var form = layui.form;
            var laydate = layui.laydate;

            //日期范围
            laydate.render({
                elem: '#test6'
                ,range: true
            });

            //监听指定开关-修改状态
            form.on('switch(change_state)',
                function (obj) {
                    change_state(this);
                });

            //监听搜索
            form.on('submit(sreach)',
                function (data) {
                    var $_url = full_url('{{route('admin_admin_index')}}', data.field);
                    location_redirect($_url)
                });
            form.render();
        });
    </script>
@endsection




